﻿using Modules.Project;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;

namespace Modules
{
    /// <summary>
    /// 保证金账户信息
    ///</summary>
    [TableName("project_security_deposit")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class ProjectSecurityDeposit : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 项目id
        ///</summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 单据号
        ///</summary>
        [Column("code")]
        public string Code { get; set; }

        /// <summary>
        /// 流水号
        ///</summary>
        [Column("serial_number")]
        public int SerialNumber { get; set; }

        /// <summary>
        /// 缴纳主体名称
        ///</summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 缴纳主体同意社会信用代码
        ///</summary>
        [Column("bcode")]
        public string BCode { get; set; }

        /// <summary>
        /// 银行是否对账户设置特殊标识
        ///</summary>
        [Column("identifying")]
        public bool Identifying { get; set; }

        /// <summary>
        /// 是否已退还
        ///</summary>
        [Column("is_refund")]
        public bool IsRefund { get; set; }

        /// <summary>
        /// 退还金额
        ///</summary>
        [Column("refund_amount")]
        public decimal? RefundAmount { get; set; }

        /// <summary>
        /// 退还日期
        ///</summary>
        [Column("refund_date")]
        public DateTime? RefundDate { get; set; }

        /// <summary>
        /// 退还决定单位名称
        ///</summary>
        [Column("refund_corp_name")]
        public string? RefundCorpName { get; set; }

        /// <summary>
        /// 退还决定单位统一社会信用代码
        ///</summary>
        [Column("refund_corp_code")]
        public string? RefundCorpCode { get; set; }

        /// <summary>
        /// 动用通知文书号
        ///</summary>
        [Column("instrument_number")]
        public string? InstrumentNumber { get; set; }

        /// <summary>
        /// 是否已核实
        ///</summary>
        [Column("is_verify")]
        public bool? IsVerify { get; set; }

        /// <summary>
        /// 核实结论(1通过,-1不通过)
        ///</summary>
        [Column("virify_conclusion")]
        public 核实结论? VirifyConclusion { get; set; }

        /// <summary>
        /// 结论说明(不通过原因   为不通过时必填)
        ///</summary>
        [Column("virify_instructions")]
        public string? VirifyInstructions { get; set; }

        /// <summary>
        /// 已核实时间
        ///</summary>
        [Column("verify_time")]
        public DateTime? VerifyTime { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}